{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Function for caluclator for +,-,*,/ \n",
    "\n",
    "def calculator(num1,num2,op):\n",
    "    if op == \"+\":\n",
    "        return num1 +num2\n",
    "    elif op == \"-\":\n",
    "        return num1 -num2    \n",
    "    elif op == \"*\":\n",
    "        return num1 * num2\n",
    "    elif op == \"/\":\n",
    "        return num1 / num2\n",
    "    else:\n",
    "        return \"Give proper Operand, +, - , *, /\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "32"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "calculator(45,13,'-')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Give proper Operand, +, - , *, /'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "calculator(45,13,'k')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Assignment number 1 \n",
    "\n",
    "Write a program to identify sub list [1,1,5] is there in the given list in the same order, if yes print “it's a Match” if no then print “it's Gone” in function\n",
    "\n",
    "Example - \n",
    "Listy = [1,5,6,4,1,2,3,5] - it's a Match\n",
    "Listy = [1,5,6,5,1,2,3,6] - it's Gone"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " it's Gone \n"
     ]
    }
   ],
   "source": [
    "listy =  [1,5,6,4,1,2,3]\n",
    "\n",
    "sub_list = [1,1,5]\n",
    "\n",
    "\n",
    "for item in listy:\n",
    "    if item == sub_list[0]:\n",
    "        sub_list.pop(0)\n",
    "        \n",
    "if len(sub_list) == 0:\n",
    "    print(\" it's a Match \")\n",
    "else:\n",
    "    print(\" it's Gone \")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
